#!/bin/bash

## argv[1] is the name of the test, the rest are apachabench arguments

testname="$1"
shift

ab -g $testname.gnuplot.out "$@" &> $testname.out

title="$@"
title=`echo $title | tr -d "'"`

cp ab-gnuplot.common.p $testname.gnuplot.p
echo "set output '$testname.gnuplot.png'" >>$testname.gnuplot.p
echo "set title '$title'" >>$testname.gnuplot.p
echo "plot '$testname.gnuplot.out' using 9 smooth sbezier with lines" >>$testname.gnuplot.p

gnuplot $testname.gnuplot.p
